namespace Cos.Core.NHibernate.Mapping
{
    using FluentNHibernate.Mapping;
    
    public class PageMap : ClassMap<PageDataModel>
    {
        #region Constructors and Destructors

        public PageMap()
        {
            this.Table("Page");
            this.LazyLoad();
            this.Id(x => x.Id).GeneratedBy.Native().Column("PageID");
            this.Map(x => x.NavId).Column("NavID");
            this.Map(x => x.CultureCode).Column("CultureCode");
            this.Map(x => x.PageName).Column("PageName");
            this.Map(x => x.PageStatus).Not.Nullable().Column("PageStatus");
            this.Map(x => x.PageNavEnd).Not.Nullable().Column("PageNavEnd");
            this.Map(x => x.CreationDate).Column("CreationDate");
            this.Map(x => x.LastModified).Column("LastModified");
            this.Map(x => x.Author).Column("Author");
            this.Map(x => x.PageNamePreview).Column("PageNamePreview");
            this.Map(x => x.PageVisibilityPreview).Column("PageVisibilityPreview");
            this.Map(x => x.PageVisibility).Column("PageVisibility");
            this.Map(x => x.ApprobationDate).Column("ApprobationDate");
            //this.HasMany(x => x.Elements).Not.KeyNullable().KeyColumn("PageID");
        }

        #endregion
    }
}